package com.chinasofti.demo11;

public class W {

    final int a = 10;

    public void t1(){
        //a = 20; final修饰的基本类型变量的值不能改
    }

    public static void main(String[] args) {
        final S s = new S(23);
        //s = new S(24); 错误
        s.setA(1);
    }

}

class S{
    int a;

    public S(int a) {
        this.a = a;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }
}